package it.uniroma2.art.coda.projectionrule.antlr.test;

import it.uniroma2.art.coda.core.CODACore;
import it.uniroma2.art.coda.exception.PRParserException;
import it.uniroma2.art.coda.projectionrule.ParserPR;
import it.uniroma2.art.coda.projectionrule.ProjectionRulesModel;
import it.uniroma2.art.coda.projectionrule.antlr.ANTLRParserPR;

public class PrintProjRuleModel {

	/**
	 * @param args
	 * @throws PRParserException 
	 */
	public static void main(String[] args) throws PRParserException {
		//String prPath = "E:/CODATest/provaPRPrint.pr";
		String prPath = "E:/CODATest/provaPR.pr";
		
		ProjectionRulesModel prModel = new ProjectionRulesModel();
		ParserPR antlrParser = new ANTLRParserPR("ANTLRParser", "this is an ANTRL Parser");
		try{
			CODACore codaCore = new CODACore();
			antlrParser.initialize(prModel, prPath, codaCore);
			antlrParser.parsePR();
			System.out.println("parsing complete"); //
			prModel.printModel();
		}
		catch (PRParserException ex){
			String msg = ex.getMessage();
			System.out.println(msg);
		}

	}
}
